Integrand size = 26, antiderivative size = 98 \[ \int \frac {\tan ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\frac {i \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}-\frac {i}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d} \]
[Out]
Time = 0.12 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3624, 3560, 3561, 212} \[ \int \frac {\tan ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\frac {i \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}-\frac {i}{d \sqrt {a+i a \tan (c+d x)}} \]
[In]
[Out]
Rule 212
Rule 3560
Rule 3561
Rule 3624
Rubi steps \begin{align*} \text {integral}& = -\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}-\int \frac {1}{\sqrt {a+i a \tan (c+d x)}} \, dx \\ & = -\frac {i}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}-\frac {\int \sqrt {a+i a \tan (c+d x)} \, dx}{2 a} \\ & = -\frac {i}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}+\frac {i \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d} \\ & = \frac {i \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}-\frac {i}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d} \\ \end{align*}
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.29 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.61 \[ \int \frac {\tan ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {i \left (2+\operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},\frac {1}{2} (1+i \tan (c+d x))\right )+2 i \tan (c+d x)\right )}{d \sqrt {a+i a \tan (c+d x)}} \]
[In]
[Out]
Time = 0.93 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.77
method | result | size |
derivativedivides | \(\frac {2 i \left (-\sqrt {a +i a \tan \left (d x +c \right )}+\frac {\sqrt {a}\, \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{4}-\frac {a}{2 \sqrt {a +i a \tan \left (d x +c \right )}}\right )}{d a}\) | \(75\) |
default | \(\frac {2 i \left (-\sqrt {a +i a \tan \left (d x +c \right )}+\frac {\sqrt {a}\, \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{4}-\frac {a}{2 \sqrt {a +i a \tan \left (d x +c \right )}}\right )}{d a}\) | \(75\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 238 vs. \(2 (73) = 146\).
Time = 0.24 (sec) , antiderivative size = 238, normalized size of antiderivative = 2.43 \[ \int \frac {\tan ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\frac {{\left (i \, \sqrt {2} a d \sqrt {\frac {1}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (4 \, {\left ({\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {1}{a d^{2}}} + a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - i \, \sqrt {2} a d \sqrt {\frac {1}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (-4 \, {\left ({\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {1}{a d^{2}}} - a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - 2 \, \sqrt {2} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} {\left (5 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )}\right )} e^{\left (-i \, d x - i \, c\right )}}{4 \, a d} \]
[In]
[Out]
\[ \int \frac {\tan ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\int \frac {\tan ^{2}{\left (c + d x \right )}}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )}}\, dx \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.03 \[ \int \frac {\tan ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {i \, {\left (\sqrt {2} a^{\frac {5}{2}} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) + 8 \, \sqrt {i \, a \tan \left (d x + c\right ) + a} a^{2} + \frac {4 \, a^{3}}{\sqrt {i \, a \tan \left (d x + c\right ) + a}}\right )}}{4 \, a^{3} d} \]
[In]
[Out]
\[ \int \frac {\tan ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\int { \frac {\tan \left (d x + c\right )^{2}}{\sqrt {i \, a \tan \left (d x + c\right ) + a}} \,d x } \]
[In]
[Out]
Time = 0.29 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.85 \[ \int \frac {\tan ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {1{}\mathrm {i}}{d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}-\frac {\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,2{}\mathrm {i}}{a\,d}-\frac {\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-a}}\right )\,1{}\mathrm {i}}{2\,\sqrt {-a}\,d} \]
[In]
[Out]